import React, { Component } from 'react'
import Rank from './Rank'
import SongList from './SongList'
import NotFount from './NotFound'
import './index.css'
import { NavLink, Route, Switch, Redirect } from 'react-router-dom'
export default class My extends Component {
  render() {
    return (
      <div>
        <h1>我的音乐子路由</h1>
        <ul>
          <li><NavLink to="/my/rank">排行榜</NavLink></li>
          <li><NavLink to="/my/songList">歌单</NavLink></li>
        </ul>
        <Switch>
          <Redirect exact from="/my" to="/my/rank" ></Redirect>
          <Route path="/my/rank" component={Rank}></Route>
          <Route path="/my/songList" component={SongList}></Route>
          <Route component={NotFount}></Route>
        </Switch>
      </div>
    )
  }
}
